/* 
 * Shows map with images as placemarks
 *
 */

var map, layer;

function init(){
    OpenLayers.ProxyHost="/proxy/?url=";
    map = new OpenLayers.Map('map');
    /*var map = new OpenLayers.Map ("map", {
                    controls:[
                        new OpenLayers.Control.Navigation(),
                        new OpenLayers.Control.PanZoomBar(),
                        new OpenLayers.Control.LayerSwitcher(),
                        new OpenLayers.Control.Attribution()],
                    maxExtent: new OpenLayers.Bounds(-20037508.34,-20037508.34,20037508.34,20037508.34),
                    maxResolution: 156543.0399,
                    numZoomLevels: 19,
                    units: 'm',
                    projection: new OpenLayers.Projection("EPSG:900913"),
                    displayProjection: new OpenLayers.Projection("EPSG:4326")
                } );*/


    layer = new OpenLayers.Layer.WMS( "OpenLayers WMS", "http://labs.metacarta.com/wms/vmap0", {
        layers: 'basic'
    } );


    map.addLayer(layer);
    /*
                var layerTilesAtHome = new OpenLayers.Layer.OSM.Osmarender("Osmarender", {layers: 'basic'});
                map.addLayer(layerTilesAtHome);

                var mapnik = new OpenLayers.Layer.OSM.Mapnik("Mapnik");
                map.addLayer(mapnik);
                 */
    var yahoo = new OpenLayers.Layer.Yahoo(
        "Yahoo Street",
        {
            'sphericalMercator': false
        }
        );
    map.addLayer(yahoo);

    //var newl = new OpenLayers.Layer.Text( "Posizioni GNU", {location: "./positions.txt"} );
    var newl = new OpenLayers.Layer.Text( "Posizioni GNU", {
        location: "PositionsQuery.php"
    } );
    map.addLayer(newl);

    map.addControl(new OpenLayers.Control.LayerSwitcher());
    //map.zoomToMaxExtent();

    var lat=44.085001;
    var lon=12.398817;
    var zoom=3;
    var lonLat = new OpenLayers.LonLat(lon, lat).transform(new OpenLayers.Projection("EPSG:4326"), map.getProjectionObject());

    map.setCenter (lonLat, zoom);
}
